#include <stdio.h>
#include "lw_oopc.h"

CLASS(Circle)
{
    double (*cal_area)(double);
};

double func1(double r)
{
    return 3.14 * r * r;
}

CTOR(Circle)
    FUNCTION_SETTING(cal_area, func1)
END_CTOR

int main(void)
{
    double area;
    Circle *pc;

    pc = (Circle*)CircleNew();
    area = pc->cal_area(10);
    printf("area = %6.2f\n", area);

    getchar();
    return 0;
}
